<html>
<head><meta charset="utf-8"><title>Send/Sync checking for closures and futures? · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html">Send/Sync checking for closures and futures?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="224930623"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224930623" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224930623">(Feb 02 2021 at 20:21)</a>:</h4>
<p>Where are Send and Sync checking for closures and futures implemented?</p>



<a name="224931158"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224931158" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> osa1 <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224931158">(Feb 02 2021 at 20:25)</a>:</h4>
<p>I've been searching this for a while now with no luck. Is it not in rustc_trait_selection?</p>



<a name="224931393"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224931393" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224931393">(Feb 02 2021 at 20:26)</a>:</h4>
<p>there might not be any special code for them</p>



<a name="224931415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224931415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224931415">(Feb 02 2021 at 20:27)</a>:</h4>
<p>it could go through the type visitor interface</p>



<a name="224935210"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224935210" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scottmcm <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224935210">(Feb 02 2021 at 20:56)</a>:</h4>
<p><span class="user-mention silent" data-user-id="119169">osa1</span> <a href="#narrow/stream/182449-t-compiler.2Fhelp/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F/near/224930623">said</a>:</p>
<blockquote>
<p>Where are Send and Sync checking for closures and futures implemented?</p>
</blockquote>
<p>They're <code>auto trait</code>s, so you might want to look for that.</p>



<a name="224935643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Send/Sync%20checking%20for%20closures%20and%20futures%3F/near/224935643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Send.2FSync.20checking.20for.20closures.20and.20futures.3F.html#224935643">(Feb 02 2021 at 20:59)</a>:</h4>
<p>Diagnostic suggestion for send/sync are in trait_selection. You might want to see where this function is called from <a href="https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs#L1228-L1270">https://github.com/rust-lang/rust/blob/master/compiler/rustc_trait_selection/src/traits/error_reporting/suggestions.rs#L1228-L1270</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>